#ifndef VISUALIZER_H
#define VISUALIZER_H
#include "opencv2\opencv.hpp"
#include "CUDAAcceleration.h"
#include "XnCppWrapper.h"
#include <iostream>
#include <fstream>

class Visualizer{
public:
	enum MemLocation{host, device};


	Visualizer(int width, int height);

	void display(short* in, int min = 500, int max = 5500, int mode = host);
	void display(int* in, int min = 500, int max = 5500, int mode = host);
	void display(float* in, float min = 500.0, float max = 5500.0, int mode = host);
	void display(float3* in, int mode = host);
	void display(xn::ImageMetaData* img);

	void display(cv::Mat& in, const cv::Mat_<int>* label,  const std::string& name);
	void display(xn::ImageMetaData* img, cv::Mat_<int>* label);
	
	void display(xn::DepthMetaData* depth);
	void display(cv::Mat* depth, const std::string& name);
	void Visualizer::display(cv::Mat& in, const std::string& name);
	void fileOut(int* in, const char* str, int mode = host);
	void fileOut(float* in, const char* str, int mode = host);
	void fileOut(bool* in, const char* str, int mode = host);



private:

	void getRGB(float ratio, unsigned char* r, unsigned char* g, unsigned char* b);
	void setRGB(cv::Vec3b* ref, unsigned char r, unsigned char g, unsigned char b);

	

	int width;
	int height;
	unsigned char** colors;
	cv::Mat_<cv::Vec3b> out;
};
#endif